package zuoye;

import java.util.ArrayList;
import java.util.Random;


public class zuoye13 {
	
public static void main(String[] args) {
	Random r=new Random();
	ArrayList<Integer> list=new ArrayList<>();
	for(int i=0;i<6;i++){
	int num1=r.nextInt(100)+1;
    if(addrandom(num1,list)){
    	list.add(num1);
}
 else{
	 i--;
	 }
}
	System.out.println(list);
}
public static boolean addrandom(int num1,ArrayList<Integer> list){
			for(int j=0;j<list.size();j++){
				if(list.get(j)==num1){
					return false;
				}
			}
			return true;
		}
}
